x86/HVM: serialize pinned cache attribute list manipulation
authorJan Beulich <jbeulich@suse.com>
Tue, 21 Mar 2023 12:01:01 +0000 (12:01 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 21 Mar 2023 12:07:42 +0000 (12:07 +0000)
commita2a915b3960e6ab060d8be2c36e6e697700ea87c
tree1a55589b251e9b3a5c06982df5ecb032fefc794f
parentd0cb66d59a956ccba3dbe794f4ec01e4a4269ee9
x86/HVM: serialize pinned cache attribute list manipulation

While the RCU variants of list insertion and removal allow lockless list
traversal (with RCU just read-locked), insertions and removals still
need serializing amongst themselves. To keep things simple, use the
domain lock for this purpose.

This is CVE-2022-42334 / part of XSA-428.

Fixes: 642123c5123f ("x86/hvm: provide XEN_DMOP_pin_memory_cacheattr")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
(cherry picked from commit 829ec245cf66560e3b50d140ccb3168e7fb7c945)
xen/arch/x86/hvm/mtrr.c